﻿@using Microsoft.AspNetCore.Identity
@using StsServerIdentity.Models
@using StsServerIdentity.Resources
@inject LocService SharedLocalizer

@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager

@if (SignInManager.IsSignedIn(User))
{
    <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right">
        <ul class="nav navbar-nav navbar-right">
            <li class="nav-item">
                <a class="nav-link" asp-area="" asp-controller="Grants" asp-action="Index">@SharedLocalizer.GetLocalizedHtmlString("GRANTS")</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">@UserManager.GetUserName(User)</a>
            </li>
            <li class="nav-item">
                <button type="submit" class="btn btn-link navbar-btn navbar-link">@SharedLocalizer.GetLocalizedHtmlString("LOGOUT")</button>
            </li>
        </ul>
    </form>
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li class="nav-item"><a class="nav-link" asp-area="" asp-controller="Account" asp-action="Register">@SharedLocalizer.GetLocalizedHtmlString("REGISTER")</a></li>
        <li class="nav-item"><a class="nav-link" asp-area="" asp-controller="Account" asp-action="Login">@SharedLocalizer.GetLocalizedHtmlString("ACCOUNT_LOGIN")</a></li>
    </ul>
}
